package com.nft.service.school.mapper;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.nft.service.school.entity.BookContentEntity;
import com.nft.service.school.resp.BookContentResp;
import com.nft.service.school.resp.SchoolActivityResp;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
@DS("master")
public interface BookContentMapper extends BaseMapper<BookContentEntity> {
    @Select("select id,file_url as fileUrl,jxfileurl from nd_tasks_annex where task_id=#{taskId} and type='1' order by id asc")
    public List<BookContentResp> selectContentListByTaskId(@Param("taskId")Long taskId);

    @Select("select @rownum:=@rownum+1 as qno, id,file_url as fileUrl,jxfileurl from (SELECT @rownum := 0) t,nd_tasks_annexd where content_id=#{contentId} order by id asc")
    public List<BookContentResp> selectContentDListByTaskId(@Param("contentId")Long contentId);
}
